package com.prd.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.prd.dto.CustomerDTO;
import com.prd.model.CustomerDO;
import com.prd.util.JsonData;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 客户总表 服务类
 * </p>
 *
 * @author o1
 * @since 2023-11-03
 */
public interface CustomerService extends IService<CustomerDO> {

    /**
     * 单一导入
     * @param customerDTO
     * @return
     */
    JsonData addCustomer(CustomerDTO customerDTO);


    /**
     * 强行回收至公共资源库. 强行移交，隐藏，删除
     * @param customerId
     * @param customerStatus
     * @return
     */
    JsonData changeStatus(String customerId, int customerStatus);


    /**
     * 客户-首页， 带分页，导出
     * {@link CustomerDTO}
     *
     * @param page
     * @param size
     * @param customerType
     * @param businessManagerId
     * @param businessDepartmentId
     * @param businessStatus
     * @param status
     * @param area
     * @param date
     * @oaram customerLevel
     * @oaram customerStatus
     * @return
     */
    Map<String, Object> getAllCustomer(int page, int size, int customerType, int customerLevel, int customerStatus, int businessManagerId,
                                       int businessDepartmentId, int businessStatus, int status, String area, Date date);

    /**
     * 模糊搜索
     * 只检索客户编号/客户名称/手机号/公司
     * @param page
     * @param size
     * @param keyWord
     * @return
     */
    Map<String, Object> queryCustomer(int page, int size, String keyWord);

    /**
     * 更换业务负责人
     * @param customer_no
     * @param bus_manager
     * @param bus_department
     * @param bus_phone
     * @param bus_manager_id
     * @return
     */
    JsonData updateBusinessManagerInfo(String customer_no, String bus_manager, String bus_department, String bus_phone, int bus_manager_id);

    /**
     * 获取一个客户对象
     *
     * @param customerNo
     * @return
     */
    CustomerDTO getOne(String customerNo);


    /*------------------- UNI --------------------*/
    /**
     * uni新增详细客户
     * @param customerDTO
     * @return
     */
    JsonData uAddDetail(CustomerDTO customerDTO);

    /**
     * uni新增分公司/分店
     * @param customerDTO
     * @return
     */
    JsonData uAddSubDetail(CustomerDTO customerDTO);

    /**
     * uni修改报备
     * @param customerDTO
     * @return
     */
    JsonData uUpdateDetail(CustomerDTO customerDTO);

    /**
     * uni报备详情
     * @param customerNo
     * @return
     */
    JsonData uInfo(String customerNo);

    /**
     * uni查看拥有的分店/分公司
     *
     * @param bossNo
     * @param customerNo
     * @return
     */
    List<CustomerDTO> uQuerySubCustomer(String bossNo, String customerNo);

    /**
     * uni客户名录列表
     *
     * @param page
     * @param size
     * @param keyWord
     * @param customerType
     * @param customerStatus
     * @param softOf
     * @param orderBy
     * @param address
     * @param customerLevel
     * @param businessStatus
     * @param lastBusinessDay
     * @return
     */
    Map<String, Object> uQueryCustomer(int page, int size, String keyWord, int customerType, int customerStatus, int softOf, int orderBy, String address, int customerLevel, int businessStatus, int lastBusinessDay);

    /**
     *
     * @param keyWord
     * @param customerType
     * @param customerStatus
     * @param softOf
     * @param orderBy
     * @param address
     * @param customerLevel
     * @param businessStatus
     * @param lastBusinessDay
     * @return
     */
    List<CustomerDTO> uQueryCustomer2(String keyWord, int customerType, int customerStatus, int softOf, int orderBy, String address, int customerLevel, int businessStatus, int lastBusinessDay);

    /**
     *
     * @param customerNo
     * @param isCollect
     * @return
     */
    JsonData uCollect(String customerNo, int isCollect);

    /**
     *
     * @param customerNo
     * @param isPinTop
     * @return
     */
    JsonData uPinTop(String customerNo, int isPinTop);

    /**
     *
     * @param customerNo
     * @param businessManagerId
     * @param businessManager
     * @param businessDepartmentId
     * @param businessDepartment
     * @param businessPhone
     * @return
     */
    JsonData uChangeBusinessId(String customerNo, int businessManagerId, String businessManager, int businessDepartmentId, String businessDepartment, String businessPhone);

    /**
     *
     * @return
     */
    Map<String, Object> uCountCustomerType();

    /**
     * 简易报备
     * @param customerDTO
     * @return
     */
    JsonData uAddSimple(CustomerDTO customerDTO);

    /**
     * 合并
     * @param customerDTO
     * @return
     */
    JsonData uMerge(CustomerDTO customerDTO);


    JsonData uRemoveGuestInfo(String customerNo, String guestNo);

    /**
     * 列表详情
     * @param customerNo
     * @return
     */
    JsonData uInfo2(String customerNo);

    /**
     * 删除分公司/分店
     * @param customerBossNo
     * @param customerNo
     * @return
     */
    JsonData uDeleteSubDetail(String customerBossNo, String customerNo);
}
